<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div></div>
  <script>
    // 1. 选择元素
    var div = document.getElementsByTagName('div')[0];

    // 2. 设置样式
    div.style.width = '0px';
    div.style.height = '0px';
    div.style.border = "50px solid transparent";
    div.style.borderBottomColor = '#fac';
  </script>
</body>
</html>